<?php
/**
 * ExtEditorGridPanel class file
 *
 * @author TrueSoftware B.V. (The Netherlands)
 * @link http://www.ext4yii.com
 * @copyright Copyright 2007-2010 TrueSoftware B.V. all rights reserved.
 * @license http://www.ext4yii.com/license/
 *          EVALUATION VERSION - NOT FOR COMMERCIAL USE OR DISTRIBUTION.
 * @version 0.7.2
 */

class ExtEditorGridPanel extends ExtGridPanel
{
    /**
     * Gets the value of ExtJS autoEncode property
     * @return Boolean 
     */
    public function getAutoEncode()
    {
    	return $this->getConfig("autoencode");
    }

    /**
     * Sets the value of ExtJS autoEncode property
     * @param Boolean $value 
     */
    public function setAutoEncode($value)
    {
    	$this->setConfig("autoencode",$value);
    }

    /**
     * Gets the value of ExtJS clicksToEdit property
     * @return Number 
     */
    public function getClicksToEdit()
    {
    	return $this->getConfig("clickstoedit");
    }

    /**
     * Sets the value of ExtJS clicksToEdit property
     * @param Number $value 
     */
    public function setClicksToEdit($value)
    {
    	$this->setConfig("clickstoedit",$value);
    }

    /**
     * Gets the value of ExtJS forceValidation property
     * @return Boolean 
     */
    public function getForceValidation()
    {
    	return $this->getConfig("forcevalidation");
    }

    /**
     * Sets the value of ExtJS forceValidation property
     * @param Boolean $value 
     */
    public function setForceValidation($value)
    {
    	$this->setConfig("forcevalidation",$value);
    }

    /**
     * @description maps to the startEditing function in Ext.grid.EditorGridPanel
     * @param sender String -
     * @param rowIndex Number -
     * @param colIndex Number - 
     */
    public static function startEditing_OnAjax($rowIndex,$colIndex,$sender=null)
    {
    	ExtWidget::checkSetAjaxRequestValue('startEditing(%s,%s)',
    		array($rowIndex,$colIndex),
    			 $sender);
    }

    /**
     * @description maps to the stopEditing function in Ext.grid.EditorGridPanel
     * @param sender String -
     * @param cancel Boolean optional 
     */
    public static function stopEditing_OnAjax($cancel=null,$sender=null)
    {
    	ExtWidget::checkSetAjaxRequestValue('stopEditing(%s)',
    		array($cancel),
    			 $sender);
    }

    
    public function __construct()
    {
        parent::__construct();
        $this->configmap = array_merge($this->configmap,array(
            'autoencode' => 'autoEncode',
            'clickstoedit' => 'clicksToEdit',
            'forcevalidation' => 'forceValidation'
        ));

        $this->eventtable = array_merge($this->eventtable,array(
            'afteredit' => array('e'),
            'beforeedit' => array('e'),
            'validateedit' => array('e')
        ));


        $this->setXType('editorgrid');
        $this->setXClass('Ext.grid.EditorGridPanel');
    }    
}
?>